library _;

import 'dart:io';
import 'dart:ui';

import 'package:chewie/chewie.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/Util/FileUtils.dart';
import 'package:flutter_app/Util/YOSS/YOSS.dart';
import 'package:flutter_yfree/YFree.dart';
import 'package:gallery_saver/gallery_saver.dart';
import 'package:universal_html/html.dart' as html;
import 'package:video_player/video_player.dart';

part 'controller.dart';

part 'view.dart';

class ShowVideoPage extends YPage {
  ShowVideoPage({required this.video});

  String video;

  VideoPlayerController? videoController;
  ChewieController? chewieController;
  bool isPlaying = false;
  bool isNet = true;
  VoidCallback? listener;
  Duration? lastPosition;

  @override
  void yOnCreate() {
    controller_initVideo();
  }

  @override
  void yOnDestory() {
    controller_disposeVideo();
  }

  @override
  bool ySafeAreaBottom() => false;

  @override
  Widget yBuild(BuildContext context) {
    return AnnotatedRegion(
      value: SystemUiOverlayStyle.light,
      child: Stack(
        children: [
          view_video(),
          view_close(),
          view_netState(),
        ],
      ),
    );
  }
}
